package cn.cai.utils;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

/**
 * URL 编码工具类
 */
public class URLUtil {
    public static String coding(String param){
        String result = "";
        try {
            result = URLEncoder.encode(param,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        if (result.equals("")){
            return "";
        }
        return result;
    }
}
